package com.maigu.service.impl;

import com.maigu.dataobject.ProductCategory;
import com.maigu.dao.ProductCategoryDao;
import com.maigu.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private ProductCategoryDao repository;//引入DAO
    @Override
    public ProductCategory findOne(Integer categoryId) {

        return repository.findOne(categoryId);

    }

    @Override
    public List<ProductCategory> finAll() {
        return repository.findAll();
    }

    @Override
    public List<ProductCategory> findByCategoryTypeIn(List<Integer> categoryTypeList) {
        return repository.findByCategoryTypeIn(categoryTypeList);
    }

    @Override
    public ProductCategory save(ProductCategory productCategory) {
        return repository.save(productCategory);
    }
}
